package com.ctshk.rpc.starvip.factory.transaction;

import com.ctshk.common.utils.EntityUtil;
import com.ctshk.rpc.starvip.dto.start_vip.SiebelMessage;
import com.ctshk.rpc.starvip.dto.start_vip.transaction.*;
import com.ctshk.rpc.starvip.factory.StarVipReqProvider;
import com.ctshk.rpc.starvip.req.transaction.StarVipTransactionQueryReq;
import com.google.common.collect.Lists;
/**
 * @BelongsProject: ctshk-cloud
 * @BelongsPackage: com.ctshk.rpc.starvip.factory.transaction
 * @Author: hef
 * @CreateTime: 2021-04-14 09:42
 * @Description: 描述
 */
public class TransactionQueryReqFactory extends StarVipReqProvider<StarVipTransactionQueryReq> {

    public TransactionQueryReqFactory(StarVipTransactionQueryReq req) {
        super(req);
    }

    @Override
    public SiebelMessage produce() {
        TransactionQueryDTO dto = new TransactionQueryDTO();
        dto.setMessageId("String");
        dto.setIntObjectName("CTS LOY Transaction Query");
        dto.setInterfaceId("CTS_IF_18");
        dto.setOperation("Query");
        dto.setMessageType("Integration Object");
        dto.setIntObjectFormat("Siebel Hierarchical");
        dto.setStartRowNum(String.valueOf(req.getPageNo()));
        dto.setPageSize(String.valueOf(req.getPageSize()));
        dto.setNewQuery("true");

        dto.setListOfCtsLoyTransactionQuery(new ListOfCtsLoyTransactionQuery(
                Lists.newArrayList(new LoyTransactionQuery()
                .setMemberId(req.getMemberId())
                        .setTransactionBeginDate(req.getTransactionBeginDate())
                        .setTransactionEndDate(req.getTransactionEndDate())
                        .setTransactionType(req.getTransactionType())
                )
        ));
        return dto;
    }
}
